package com.exchange.mon.common.result;

public enum ResultCode implements IResultCode {
	/*
	 * 请求返回状态码和说明信息
	 */
	FAIL(0,"FAIL"),
	SUCCESS(200, "SUCCESS"), 
	BAD_REQUEST(400, "Param Error"),
	UNAUTHORIZED(401, "Authentication Failed"),
	LOGIN_ERROR(402, "Login Fail, UserName or Password is Wrong"),
	FORBIDDEN(403,  "Forbidden Access"), 
	NOT_FOUND(404, "Resource Empty"),
	OPERATE_ERROR(405, "Resource does not exist"),
	TIME_OUT(408, "Request Timeout"),
	TOO_MANY_REQUEST(429, "Request Too Many"),
	SIGN_ERROR(409, "Sign Error"),
	SERVER_ERROR(500, "System Error");

	private int code;
	private String message;

	ResultCode(int code, String message) {
		this.code = code;
		this.message = message;
	}

	@Override
	public int getCode() {
		return this.code;
	}

	@Override
	public String getMessage() {
		return this.message;
	}
}
